package com.itheima.homework;

import java.util.Scanner;

public class Demo6 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入数字:");
        double i=sc.nextDouble();
        System.out.println("你输入的数字绝对值为"+getZheng(i));
    }

    public static double getZheng(double a){
        if(a<=0){
            a=-a;
        }
        return a;
    }
}
